/* 凯撒加密 */
#include <stdio.h>
#define N 80
void encrypy(char *messages, int shift);
int main(void)
{
    char ch, msg[N+2];
    printf("Enter message to be encrypted: ");
    fgets(msg, N+2, stdin);
    printf("Enter shift amout (1-25): ");
    int shift;
    scanf("%d", &shift);
    encrypy(msg, shift);
    printf("Encrypted message: %s", msg);
    return 0;
}
void encrypy(char *messages, int shift) {
    for (char *p = messages; *p; p++)
        if ((*p - 'A' >= 0 && *p - 'A' < 26) || (*p - 'a' >= 0 && *p - 'a' < 26))
            *p += shift;
}